MPC AP algorithm